package top.wshape1.shiziapi.mock.controller;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.script.ScriptEngine;
import javax.script.ScriptException;

/**
 * @author Wshape1
 * @version 1.0
 * @description
 * @since 2023-10-08
 */

@RestController
public class TestController {

    @Resource
    private ScriptEngine scriptEngine;

    @GetMapping("/mock")
    public Object g() throws ScriptException {
        return scriptEngine.eval("Mock.mock({'string|1-10': 'x'})");
    }

}
